﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Admin_Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
                <img src="../images/loading_2.gif" />
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Button ID="btn_on" runat="server" Text="on" OnClick="btn_Click" />
                <asp:DropDownList ID="drop" runat="server" AutoPostBack="true">
                    <asp:ListItem Value="1" Text="0"></asp:ListItem>
                    <asp:ListItem Value="2" Value1></asp:ListItem>
                </asp:DropDownList>
                 <asp:TextBox ID=txt runat=server></asp:TextBox>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btn" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
       
        <asp:Button ID="btn" runat="server" Text="off" OnClick="btn_Click" />
        <script type="text/javascript">
            var prm = Sys.WebForms.PageRequestManager.getInstance();
            prm.add_initializeRequest(InitializeRequest);
            prm.add_endRequest(EndRequest);
            var postBackElement;
            function InitializeRequest(sender, args) {
                if (prm.get_isInAsyncPostBack())
                    args.set_cancel(true);
                postBackElement = args.get_postBackElement();

                if (postBackElement.id == 'btn')
                    $get('UpdateProgress1').style.display = 'block';
            }
            function EndRequest(sender, args) {
                if (postBackElement.id == 'btn')
                    $get('UpdateProgress1').style.display = 'none';
            }
        </script>
    </div>
    </form>
</body>
</html>
